﻿namespace Magic.System;

public interface ICacheService
{
    /// <summary>
    /// 获取所有权限
    /// </summary>
    /// <returns></returns>
    Task<List<string>> GetAllPermission();
    /// <summary>
    /// 获取权限缓存（按钮）
    /// </summary>
    /// <param name="userId"></param>
    /// <returns></returns>
    Task<List<string>> GetPermission(long userId);
    /// <summary>
    /// 设置所有按钮权限
    /// </summary>
    /// <param name="permissions"></param>
    /// <returns></returns>
    Task SetAllPermission(List<string> permissions);
    /// <summary>
    /// 设置权限
    /// </summary>
    /// <param name="userId"></param>
    /// <param name="permissions"></param>
    /// <returns></returns>
    Task SetPermission(long userId, List<string> permissions);
}
